package day02.annotation;

import day02.annotation.controller.UserController;
import day02.annotation.repository.UserRepository;
import day02.annotation.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 夏焰波
 * @date 2020-08-21 2:18
 */
public class Main {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("beans-annotation.xml");
        //TestObject to = (TestObject) ctx.getBean("testObject");
        //System.out.println(to);

        UserController userController = (UserController) ctx.getBean("userController");
        System.out.println(userController);
        userController.execute();

        //UserRepository userRepository = (UserRepository) ctx.getBean("userRepository");
        //System.out.println(userRepository);

        //UserService userService = (UserService) ctx.getBean("userService");
        //System.out.println(userService);

    }
}
